home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.metal;
-
- import com.sun.java.swing.JToolBar;
- import com.sun.java.swing.plaf.basic.BasicToolBarUI;
- import java.awt.Rectangle;
- import java.awt.event.MouseEvent;
-
- class MetalToolBarUI$MetalDockingListener extends BasicToolBarUI.DockingListener {
- // $FF: synthetic field
- MetalToolBarUI this$0;
- protected boolean pressedInBumps;
-
- // $FF: synthetic method
- public MetalToolBarUI$MetalDockingListener(MetalToolBarUI this$0, JToolBar t) {
- super(this$0, t);
- this.this$0 = this$0;
- this.pressedInBumps = false;
- }
-
- public void mousePressed(MouseEvent e) {
- super.mousePressed(e);
- this.this$0.setDragOffset(e.getPoint());
- this.pressedInBumps = false;
- Rectangle bumpRect = new Rectangle();
- if (super.toolBar.getSize().height <= super.toolBar.getSize().width) {
- bumpRect.setBounds(0, 0, 14, super.toolBar.getSize().height);
- } else {
- bumpRect.setBounds(0, 0, super.toolBar.getSize().width, 14);
- }
-
- if (bumpRect.contains(e.getPoint())) {
- this.pressedInBumps = true;
- }
-
- }
-
- public void mouseDragged(MouseEvent e) {
- if (this.pressedInBumps) {
- super.mouseDragged(e);
- }
-
- }
- }
-